package com.zhai.boot.domain.in;

import com.zhai.boot.domain.json.DemoCityJson;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Arrays;
import java.util.List;

/**
 * @package: com.zhai.boot.domain.in
 * @project-name: zhai-boot
 * @description: Demo 保存 入参
 * @author: Created by 翟凤玺
 * @create-datetime: 2018-7-20 15:34
 */
@Data
public class DemoSaveIn {

    @NotBlank(message = "姓名不能为空")
    @ApiModelProperty(value = "姓名")
    private String name;

    @NotNull(message = "年龄不能为空")
    @ApiModelProperty(value = "年龄")
    private Integer age;

    @NotBlank(message = "性别不能为空")
    @ApiModelProperty(value = "性别")
    @Pattern(regexp = "^(兄贵|女|软妹子)$", message = "性别参数有误")
    private String sex;

    @NotEmpty(message = "爱好不能为空")
    @ApiModelProperty(value = "爱好")
    private List<String> hobby;

    @ApiModelProperty(value = "城市")
    private DemoCityJson city;

    public static final List PARAMS_HOBBY = Arrays.asList("跑步", "摄影", "美食", "篮球");

    public static final String ERROR_CODE_PARAMS_HOBBY = "-2";
    public static final String ERROR_MESSAGE_PARAMS_HOBBY = "爱好参数有误";
}
